/*
 * @Description: `vite` 配置文件
 * @Author: smellycat littlecandyi@163.com
 * @Date: 2025-04-12 22:07:03
 * @LastEditors: smellycat littlecandyi@163.com
 * @LastEditTime: 2025-04-13 00:39:13
 */

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import UnoCSS from 'unocss/vite'
import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
import { pathResolve } from './vite/utils'

// https://vite.dev/config/
export default defineConfig({
	plugins: [
		TanStackRouterVite({
			target: 'react',
			generatedRouteTree: './types/routeTree.gen.ts',
			autoCodeSplitting: true
		}),
		react(),
		UnoCSS()
	],
	resolve: {
		alias: [
			{ find: '@', replacement: `${pathResolve('src')}/` },
			{ find: '#', replacement: `${pathResolve('types')}/` }
		]
	}
})
